Optimal. Leaf size=177 \[ \frac {2 a^{5/2} c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a^3 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^4 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}+\frac {6 a^5 c^2 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}}+\frac {2 a^6 c^2 \tan ^7(e+f x)}{7 f (a+a \sec (e+f x))^{7/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 177, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3989, 3972,
472, 209} \begin {gather*} \frac {2 a^{5/2} c^2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}+\frac {2 a^6 c^2 \tan ^7(e+f x)}{7 f (a \sec (e+f x)+a)^{7/2}}+\frac {6 a^5 c^2 \tan ^5(e+f x)}{5 f (a \sec (e+f x)+a)^{5/2}}+\frac {2 a^4 c^2 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}-\frac {2 a^3 c^2 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 472
Rule 3972
Rule 3989
Rubi steps
\begin {align*} \int (a+a \sec (e+f x))^{5/2} (c-c \sec (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int \sqrt {a+a \sec (e+f x)} \tan ^4(e+f x) \, dx\\ &=-\frac {\left (2 a^5 c^2\right ) \text {Subst}\left (\int \frac {x^4 \left (2+a x^2\right )^2}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac {\left (2 a^5 c^2\right ) \text {Subst}\left (\int \left (-\frac {1}{a^2}+\frac {x^2}{a}+3 x^4+a x^6+\frac {1}{a^2 \left (1+a x^2\right )}\right ) \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac {2 a^3 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^4 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}+\frac {6 a^5 c^2 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}}+\frac {2 a^6 c^2 \tan ^7(e+f x)}{7 f (a+a \sec (e+f x))^{7/2}}-\frac {\left (2 a^3 c^2\right ) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 a^{5/2} c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a^3 c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^4 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}+\frac {6 a^5 c^2 \tan ^5(e+f x)}{5 f (a+a \sec (e+f x))^{5/2}}+\frac {2 a^6 c^2 \tan ^7(e+f x)}{7 f (a+a \sec (e+f x))^{7/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.97, size = 124, normalized size = 0.70 \begin {gather*} -\frac {2 a^2 c^2 \left (-105 \text {ArcTan}\left (\sqrt {-1+\sec (e+f x)}\right ) \cos ^3(e+f x)+(8+51 \cos (e+f x)+23 \cos (2 (e+f x))+23 \cos (3 (e+f x))) \sqrt {-1+\sec (e+f x)}\right ) \sec ^3(e+f x) \sqrt {a (1+\sec (e+f x))} \tan \left (\frac {1}{2} (e+f x)\right )}{105 f \sqrt {-1+\sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(322\) vs.
\(2(157)=314\).
time = 0.21, size = 323, normalized size = 1.82
method | result | size |
default | \(-\frac {c^{2} \sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \left (105 \sin \left (f x +e \right ) \left (\cos ^{3}\left (f x +e \right )\right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \sqrt {2}+210 \sin \left (f x +e \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \left (\cos ^{2}\left (f x +e \right )\right ) \sqrt {2}+105 \sin \left (f x +e \right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}} \cos \left (f x +e \right ) \sqrt {2}-736 \left (\cos ^{4}\left (f x +e \right )\right )+368 \left (\cos ^{3}\left (f x +e \right )\right )+512 \left (\cos ^{2}\left (f x +e \right )\right )-24 \cos \left (f x +e \right )-120\right ) a^{2}}{420 f \cos \left (f x +e \right )^{3} \sin \left (f x +e \right )}\) | \(323\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.86, size = 440, normalized size = 2.49 \begin {gather*} \left [\frac {105 \, {\left (a^{2} c^{2} \cos \left (f x + e\right )^{4} + a^{2} c^{2} \cos \left (f x + e\right )^{3}\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, {\left (92 \, a^{2} c^{2} \cos \left (f x + e\right )^{3} + 46 \, a^{2} c^{2} \cos \left (f x + e\right )^{2} - 18 \, a^{2} c^{2} \cos \left (f x + e\right ) - 15 \, a^{2} c^{2}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{105 \, {\left (f \cos \left (f x + e\right )^{4} + f \cos \left (f x + e\right )^{3}\right )}}, -\frac {2 \, {\left (105 \, {\left (a^{2} c^{2} \cos \left (f x + e\right )^{4} + a^{2} c^{2} \cos \left (f x + e\right )^{3}\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + {\left (92 \, a^{2} c^{2} \cos \left (f x + e\right )^{3} + 46 \, a^{2} c^{2} \cos \left (f x + e\right )^{2} - 18 \, a^{2} c^{2} \cos \left (f x + e\right ) - 15 \, a^{2} c^{2}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{105 \, {\left (f \cos \left (f x + e\right )^{4} + f \cos \left (f x + e\right )^{3}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} c^{2} \left (\int a^{2} \sqrt {a \sec {\left (e + f x \right )} + a}\, dx + \int \left (- 2 a^{2} \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int a^{2} \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{4}{\left (e + f x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.52, size = 297, normalized size = 1.68 \begin {gather*} -\frac {\frac {105 \, \sqrt {-a} a^{3} c^{2} \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right ) \mathrm {sgn}\left (\cos \left (f x + e\right )\right )}{{\left | a \right |}} - \frac {2 \, {\left (105 \, \sqrt {2} a^{6} c^{2} \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) - {\left (385 \, \sqrt {2} a^{6} c^{2} \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) + {\left (43 \, \sqrt {2} a^{6} c^{2} \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 203 \, \sqrt {2} a^{6} c^{2} \mathrm {sgn}\left (\cos \left (f x + e\right )\right )\right )} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2}\right )} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2}\right )} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a\right )}^{3} \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}}}{105 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^{5/2}\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________